﻿@model Wabo.Dal.User

@{
    ViewBag.Title = String.Format(Messages.HeadingEditUser,Model.username);
}


@using (Html.BeginForm("Edit", "User", FormMethod.Post, new { @class = "form-horizontal" }))
{
    <fieldset>
        <legend>
            @ViewBag.Title
        </legend>
        @if (ViewBag.SystemSettings.enable_active_directory_login)
        {
            <div class="control-group">
                @Html.LabelFor(x => x.domain, new { @class = "control-label" })
                <div class="controls">
                    @Html.TextBoxFor(x => x.domain)
                </div>
            </div>            
        }
        <div class="control-group">
            @Html.LabelFor(x => x.username,new { @class = "control-label" })
            <div class="controls">
                @Html.TextBoxFor(x => x.username)
                @Html.ValidationMessageFor(x => x.username)   
            </div>                
        </div>
        <div class="control-group">
            @Html.LabelFor(x => x.email,new { @class = "control-label" })   
            <div class="controls">
                @Html.TextBoxFor(x => x.email)
                @Html.ValidationMessageFor(x => x.email)   
            </div>            
        </div>
        <div class="control-group">
            @Html.LabelFor(x => x.name,new { @class = "control-label" })
            <div class="controls">
                @Html.TextBoxFor(x => x.name)
            </div>
        </div>
        <div class="control-group">
            @Html.LabelFor(x => x.last_name,new { @class = "control-label" })
            <div class="controls">
                @Html.TextBoxFor(x => x.last_name)
            </div>
        </div>       
        <div class="control-group">
            @Html.LabelFor(x => x.password,new { @class = "control-label" })    
            <div class="controls">
                @Html.PasswordFor(x => x.password)
                @Html.ValidationMessageFor(x => x.password)      
            </div>
        </div>
        <div class="control-group">
            <div class="controls">
                <label class="checkbox">
                    @Html.CheckBoxFor(x => x.locked)
                    @Html.LabelFor(x => x.locked)
                </label>             
            </div>    
        </div>
        <br/>
        <button type="submit" class="btn btn-primary">@Messages.ButtonUpdate</button>
        <a href="@Url.Action("Index", "User")" class="btn">@Messages.ButtonCancel</a>    
    </fieldset>
}
